package com.surprise.db.dao.join;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.surprise.db.dao.SimpleDAO;
import com.surprise.db.entity.join.SelectPMHelpCommentMst001Entity;

/**
 * SelectPMHelpCommentMst001.java
 * @author xuling
 * @since 2017年2月14日
 */
@Repository
public class SelectPMHelpCommentMst001 extends SimpleDAO<SelectPMHelpCommentMst001Entity> {

	/**
	 * 获得找资源的评论
	 * @param helpid 找资源ID
	 * @return 找资源的评论
	 */
	public List<SelectPMHelpCommentMst001Entity> select(Long helpid) {
		String sql = " SELECT pm_help_comment_mst.id, " +
				" pm_help_comment_mst.userid, " +
				" pm_help_comment_mst.helpid, " +
				" pm_help_comment_mst.img, " +
				" pm_help_comment_mst.content, " +
				" user.username as username, " +
				" user.portrait as portrait FROM pm_help_comment_mst INNER JOIN  " +
				" user on user.id = pm_help_comment_mst.userid " +
				" where pm_help_comment_mst.helpid = ? ";

		return super.findBySql(sql, helpid);
	}
}
